import carla
import random
import time

client = carla.Client('localhost', 2000)
client.set_timeout(2.0)
world = client.get_world()

# 多个Actor 存在list里，想一起销毁。
actor_list = world.get_actors()
for actor in actor_list:
    if 'role_name' in actor.attributes:
        # 销毁
        actor.destroy()

print("finish")